from queue import *
import random
from time import *

start = time()
n = int(input())
a = list(random.randint(1, 100000) for i in range(n))
pq = PriorityQueue()
for j in range(n):
    pq.put(a[j])
while not pq.empty():
   print(pq.get(), end=' ')
end = time()
print()
print('time = ', end - start)
